<?php

namespace App\Http\Controllers;

use Illuminate\Http\JsonResponse;
use LowCode\Core\Response;

abstract class Controller
{
    protected function success(string $message, mixed $data = null): JsonResponse
    {
        return response()->json(Response::success($message,$data));
    }

    protected function error(string $message, mixed $data = null): JsonResponse
    {
        return response()->json(Response::error($message,$data));
    }

    protected function result(mixed $data = null): JsonResponse
    {
        return response()->json(Response::success("ok",$data));
    }
}
